{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./packages.nix
    ];

  # boot-section
  boot = {
    loader = {
      grub = {
        enable = true;
        version = 2;
        device = "/dev/sda";
      };
    };
  };

  # hardware-section
  hardware = {
    pulseaudio = {
      enable = true;
    };
  };

  # network-section
  networking = {
    hostName = "rupture";
    wireless = {
      enable = false;
    };
    wicd = {
      enable = true;
    };
  };

  # internationalisation-section
  i18n = {
    consoleFont = "Lat2-Terminus16";
    consoleKeyMap = "de";
    defaultLocale = "en_US.UTF-8";
  };

  # time-section
  time = {
    timeZone = "Europe/Amsterdam";
  };

  # programs-section
  programs = {
    # ssh-client
    ssh = {
      extraConfig = ''
        # Pagekite Proxy-Configuration
        Host *.pagekite.me
          CheckHostIP no
          ProxyCommand /bin/nc -X connect -x %h:443 %h %p
      '';
    };
  };

  # service-section
  services = {
    # openssh-service
    openssh = {
      enable = true;
    };
    # cups-service
    printing = {
      enable = true;
    };
    # x11-services
    xserver = {
      enable = true;
      layout = "de";
      xkbOptions = "eurosign:e";
      synaptics = {
        enable = true;
        twoFingerScroll = true;
      };
      displayManager = {
        slim = {
          enable = true;
          defaultUser = "jv";
        };
      };
      windowManager = {
        openbox = {
          enable = true;
        };
      };
    };
  };

  # user-section
  users = {
    extraUsers = {
      jv = {
        isNormalUser = true;
        uid = 1000;
        extraGroups = [ "wheel" ];
      };
    };
  };

  # environment-section
  environment = {
    shellInit = ''
      export GTK_DATA_PREFIX=${config.system.path}
    '';
    pathsToLink = [
      "/share/themes"
      "/share/mime"
      "/share/desktop-directories"
    ];
  };

  # system-section
  system = {
    stateVersion = "16.03";
  };

}
